From 7009266305699b83a031ef4daf017d77090c018d Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Thu, 20 Nov 2003 20:16:37 +0000 Subject: [PATCH] bitkeeper revision 1.620 (3fbd2125rSiOA8VTBAprJYzUwu-e6w) xc_py.c: Clean up one method on error return. --- tools/xc/py/xc_py.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tools/xc/py/xc_py.c b/tools/xc/py/xc_py.c index 099f1878d9..0438c61369 100644 --- a/tools/xc/py/xc_py.c +++ b/tools/xc/py/xc_py.c @@ -439,7 +439,6 @@ static PyObject *pyxc_readconsolering(PyObject *self, PyObject *kwds) { XcObject *xc = (XcObject *)self; - PyObject *pystr = Py_None; unsigned int clear = 0; char str[32768]; @@ -452,10 +451,7 @@ static PyObject *pyxc_readconsolering(PyObject *self, ret = xc_readconsolering(xc->xc_handle, str, sizeof(str), clear); - if ( ret > 0 ) - pystr = PyString_FromString(str); - - return pystr; + return PyString_FromStringAndSize(str, (ret < 0) ? 0 : ret); } static PyMethodDef pyxc_methods[] = { -- 2.30.2